package com.shanghai.tcp_client.Utils;

import java.math.BigDecimal;

/**
 * Created by cuihanbing on 2017/11/1.
 */

public class DoubleUtils {
    public static double formatDoubleData(double origin, int n) {
        double result;
        BigDecimal b = new BigDecimal(origin);
        result = b.setScale(n, BigDecimal.ROUND_HALF_UP).doubleValue();
        return result;
    }
}
